/**********************************************************/
/* Goblin Defense - A tower defense game for Wii Homebrew */
/* Copyright (C) 2009 Ricardo Bueno Cordeiro              */
/* Licensed under de GNU General Public License v2.0      */
/*   See license_gplv2.txt for detalis                    */
/**********************************************************/

#include <gccore.h>

#include "effect.h"
#include "draw.h"

Effect::Effect(f32 x, f32 y, f32 w, f32 h, u32 dur, u32 sprite) : x(x), y(y), width(w), height(h), start_time(0), duration(dur), sprite(sprite) {
}

void Effect::draw() {
	Sprite::draw_sprite(this->x, this->y, this->width, this->height, this->sprite);
}

void Effect::update(u32 step) {
	this->start_time += step;
}

int Effect::remove() {
	return this->start_time > this->duration;
}
